#!/bin/bash

vol_status=$(amixer sget Master | tail -n1 | sed -r "s/.*\[(.*)\]/\1/")
vol=$(amixer get Master | tail -n1 | sed -r "s/.*\[(.*)%\].*/\1/")

if [[ "${vol_status}" == "off" ]]; then
	ICON="🔇"
elif [[ "${vol}" -gt -1 ]] && [[ "${vol}" -lt 21 ]]; then
	ICON="🔈"
elif [[ "${vol}" -gt 20 ]] && [[ "${vol}" -lt 41 ]]; then
	ICON="🔉"
elif [[ "${vol}" -gt 40 ]] && [[ "${vol}" -lt 81 ]]; then
	ICON="🔊"
elif [[ "${vol}" -gt 80 ]]; then
	ICON="📢"
fi

printf "${ICON} %s%%│" "${vol}"

# EOF
